﻿
@{
    ViewData["Title"] = "NewStory";
    Layout = "~/Views/Shared/_Layout.cshtml";
    var prevDisabled = !Model.HasPreviousPage ? "disabled" : "";
    var nextDisabled = !Model.HasNextPage ? "disabled" : "";
}

@model PaginatedList<StorySeries>
<link rel="stylesheet" href="~/css/defaultStyle.css" type="text/css" />
<h2>浏览新故事</h2>
<hr />
<!--选择新的故事 故事简介-》StoryDetail-->
<div id="content" class="container">
    <form asp-action="NewStory" method="get">
        <div class="form-actions no-color">
            <div class="row">
                <div class="col-md-4">
                    <div class="input-group">
                        <span class="input-group-btn">
                            <button class="btn btn-default" type="submit">搜索</button>
                        </span>
                        <input class="form-control" type="text" name="SearchString" value="@ViewData["currentFilter"]" />
                    </div>
                </div>
                <div class="col-md-8">
                    <a asp-action="Index"
                       asp-route-sortOrder="@ViewData["CurrentSort"]"
                       asp-route-pageNumber="@(Model.PageIndex - 1)"
                       asp-route-currentFilter="@ViewData["CurrentFilter"]"
                       class="btn btn-default @prevDisabled">
                        上一页
                    </a>
                    <a asp-action="Index"
                       asp-route-sortOrder="@ViewData["CurrentSort"]"
                       asp-route-pageNumber="@(Model.PageIndex + 1)"
                       asp-route-currentFilter="@ViewData["CurrentFilter"]"
                       class="btn btn-default @nextDisabled">
                       下一页
                    </a>
                </div>
            </div>
        </div>
    </form>
    @foreach (var i in Model)
    {
        <div class="col-md-4 unitcell">
            <h1>@i.SeriesName</h1>
            <p>@i.Text</p>
            <button class="btn btn-primary" onclick="seriesdetail('@i.ID')">详情</button>
        </div>
    }

</div>







<script>
    function seriesdetail(SeriesID) {
        debugger;
        window.location.href = '/Main/SeriesDetail?SeriesID=' + SeriesID
    }

</script>